package com.emotion.sshticket.utilitys;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Map;

public class StringUtil {
	public static boolean isNotEmpty(String value) {
		if (value == null || value.equals("")) {
			return false;
		}
		return true;
	}

	public static boolean isNull(Map m) {
		if (m == null) {
			return true;
		}
		return false;
	}

	public static String toDate(String format){
		try{
			Calendar c = Calendar.getInstance();
			return toDate(c,format);
		}catch(Exception e){
			return "";
		}
	}

	public static String toDate(Calendar cal,String format){
		try{
			SimpleDateFormat sdf = new SimpleDateFormat(format);
			return sdf.format(cal.getTime());
		}catch(Exception e){
			return "";
		}
	}
}
